package demo13StringBuffer和StringBulider;

/**
 * 验证StringBuilder效率高于String
 * @author gjw
 */
public class Demo07 {
    public static void main(String[] args) {
        //开始时间
        long start = System.currentTimeMillis();
//        String string = "";
//        for (int i = 0;i < 99999;i ++){
//            string += i;
//        }
//        System.out.println(string);

        StringBuilder stringBuilder = new StringBuilder();
        for(int i = 0;i < 99999; i ++){
            stringBuilder.append(i);
        }

        long end = System.currentTimeMillis();
        System.out.println("用时" + (end - start));

    }
}
